Skip to content

Conversation

nwalters512
Copy link
Contributor

<pre> and <textarea> are whitespace-sensitive. When pretty-printing, it's important to not inject extra whitespace when rendering them.

There may be more tags for which whitespace should be preserved; these are the two that I specifically know about.

Disclosure: I wrote the tests by hand and used GPT-5-Codex to help with the implementation.

Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 96dfd13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-render-to-string Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable but I'm a bit worried this might break folks using pretty printing in their test suites and the like. Pretty specific tags & change scenarios though, so perhaps the risk is low

@rschristian rschristian merged commit 69ed337 into preactjs:main Sep 30, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Sep 30, 2025
@nwalters512 nwalters512 deleted the pretty-format-preserve-whitespace branch October 1, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants